<?php

// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------

namespace app\portal\controller;

use cmf\controller\HomeBaseController;
use app\user\model\UserModel;
class IndexController extends HomeBaseController {

    public function index() {
        $id = cmf_get_current_user_id();
        $userModel = new UserModel();
        $info = $userModel->where("id=" . $id)->find();
        if ($info['user_category'] != 1) {
            session(null);
            $user = [];
            cmf_update_current_user($user);
        }

        return $this->fetch(':index');
    }

}
